/*
 * @Author: 周洋 1430536748@qq.com
 * @Date: 2024-07-23 00:35:54
 * @LastEditors: 周洋 1430536748@qq.com
 * @LastEditTime: 2024-08-06 14:00:15
 * @version: 1.2.2
 * @Description: 登陆/用户信息/路由 获取api
 */

import { doGet, doPost } from '@/plugins/axios/index';
import type { ILogin } from '@/types/login/index';
enum Api {
    login = "../../mock/accountToken.json",
    userinfo = "../../mock/userinfo.json",
    routes = "../../mock/routes.json",
}

/** 登陆请求 */
export function ApiLogin(loginData: ILogin): any {
    return doPost(Api.login, loginData);
}
/** 获取令牌 */
export function ApiToken(): any {
    return doGet(Api.login, null);
}

/** 获取用户信息 */
export function ApiUserInfo(): any {
    return doGet(Api.userinfo, null);
}

/** 获取路由 */
export function ApiRoutes(): any {
    return doGet(Api.routes, null);
}


export class API {
    accountToken() {
        return doGet(Api.login, null);
    }
    /** 获取用户信息 */
    userInfo() {
        return doGet(Api.userinfo, null);
    }
}